extends BoarStatusBase

var idle_time:float = 0
var max_idle_time:float = 0

func start()->void:
	idle_time = 0.0
	max_idle_time = randi_range(1,20)
	actor.play_animation("Idle")

func run_physics_process(delta)->void:
	idle_time += delta
	actor.move_and_slide()
	if idle_time > max_idle_time:
		if not find_floor():
			turn_direction()
		return change_status("Walk")
		
	if find_player():
		return change_status("Run")

func run_process(delta)->void:
	idle_velocity(delta)

func change_status(status_name:String):
	if is_weak():
		status_name = "Weak"
	super.change_status(status_name)
